#ifndef MODULESMODEL_H
#define MODULESMODEL_H

#include "../XgModulesExplorer/XgModulesCollector.h"
#include "QTreeModelItem.h"
#include <QAbstractItemModel>

class ModulesModel : public QAbstractItemModel
{
	Q_OBJECT

public:
	ModulesModel(XgModulesCollector* collector, QObject *parent);
	~ModulesModel();

public:
	QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
	QModelIndex parent ( const QModelIndex & index ) const;
	int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
	int columnCount ( const QModelIndex & parent = QModelIndex() ) const;

	virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;

private:
	void populate(XgModulesCollector* collector);

private:
	XgModulesCollector* _collector;
	QTreeModelItem* _root;
};

#endif // MODULESMODEL_H
